summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-10 21:27:12 +0100
committerGitHub <noreply@github.com>2023-01-10 21:27:12 +0100
commit0eae0b680312c6e57fa5f25de18b9ad0b42f550b (patch)
tree047cf75e640720c237c97b2e5315dedbbe8ce9fb
parentMerge pull request #9598 from liamwhite/indirect (diff)
parentqt: unlock during signal emission (diff)
downloadyuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar.gz
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar.bz2
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar.lz
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar.xz
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.tar.zst
yuzu-0eae0b680312c6e57fa5f25de18b9ad0b42f550b.zip
-rw-r--r--src/yuzu/bootmanager.cpp19
-rw-r--r--src/yuzu/bootmanager.h4
2 files changed, 21 insertions, 2 deletions
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index 3d560f303..d65991734 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -96,9 +96,9 @@ void EmuThread::run() {
m_is_running.store(false);
m_is_running.notify_all();
- emit DebugModeEntered();
+ EmulationPaused(lk);
Common::CondvarWait(m_should_run_cv, lk, stop_token, [&] { return m_should_run; });
- emit DebugModeLeft();
+ EmulationResumed(lk);
}
}
@@ -111,6 +111,21 @@ void EmuThread::run() {
#endif
}
+// Unlock while emitting signals so that the main thread can
+// continue pumping events.
+
+void EmuThread::EmulationPaused(std::unique_lock<std::mutex>& lk) {
+ lk.unlock();
+ emit DebugModeEntered();
+ lk.lock();
+}
+
+void EmuThread::EmulationResumed(std::unique_lock<std::mutex>& lk) {
+ lk.unlock();
+ emit DebugModeLeft();
+ lk.lock();
+}
+
#ifdef HAS_OPENGL
class OpenGLSharedContext : public Core::Frontend::GraphicsContext {
public:
diff --git a/src/yuzu/bootmanager.h b/src/yuzu/bootmanager.h
index eca16b313..092c6206f 100644
--- a/src/yuzu/bootmanager.h
+++ b/src/yuzu/bootmanager.h
@@ -92,6 +92,10 @@ public:
}
private:
+ void EmulationPaused(std::unique_lock<std::mutex>& lk);
+ void EmulationResumed(std::unique_lock<std::mutex>& lk);
+
+private:
Core::System& m_system;
std::stop_source m_stop_source;